﻿using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;

namespace ScannerApp
{
    public partial class SettingsForm : Form
    {
        public SettingsForm()
        {
            InitializeComponent();
            this.txtWebServiceUrl.Text = AppConfig.Instance.GetSettingValue(AppConfig.WebServiceUrlKey);
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            SaveSettings();
        }

        private void menuItem1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void menuItem2_Click(object sender, EventArgs e)
        {
            SaveSettings();
        }

        private void SaveSettings()
        {
            AppConfig.Instance.SetSettingValue(AppConfig.WebServiceUrlKey, this.txtWebServiceUrl.Text);
            AppConfig.Instance.Save();
            this.Close();
        }

    }
}